set easymotion
let mapleader=" "
" let g:keyboard_layout = "colemak"
let g:keyboard_layout = "qwer"

Plug 'tpope/vim-surround'
" Plug 'easymotion/vim-easymotion'

set keep-english-in-normal
" imap a z
let g:EasyMotion_do_mapping=0
map s <Plug>(easymotion-sn)

nmap ,f <Action>(MaximizeEditorInSplit)
inoremap jj <Esc>

nnoremap <leader>in :vsp input.txt<cr>

" Error Decription, default key: Ctrl + F1
nnoremap ,r :action RunAnything<cr>
nnoremap ,e :action ShowErrorDescription<cr>
" Next Highlighted Error, default key: Alt + F8
" nnoremap <leader>ne :action GotoNextError<cr>
" Previous Highlighted Error, default key: Alt + Shift + F8
nnoremap <leader>pe :action GotoPreviousError<cr>
nnoremap z9 :action Debug<cr>
nnoremap zm :action ToggleLineBreakpoint<cr>
nnoremap zz :action ShowExecutionPoint<cr>
nnoremap ze :action StepOver<cr>
nnoremap zi :action StepInto<cr>
nnoremap zu :action StepOut<cr>
nnoremap <leader>rn :action RenameElement<cr>
vnoremap <leader>sn :action SaveAsTemplate<cr>
" nnoremap <C-o> :action NewFile<cr>
nmap <A-h> :action PreviousTab<cr>
nnoremap <A-l> :action NextTab<cr>
nnoremap <A-j> :action GoToLastTab<cr>
nnoremap <A-r> :source ~\AppData\Local\nvim\idea.vim<cr>
nnoremap <leader>rc :source ~\AppData\Local\nvim\idea.vim<cr>
nnoremap <silent> <space>oo :exec '!alacritty.exe -e nvim -c '.line(".").' %'<cr>
noremap <A-n> :action CommentByLineComment<cr>
" nnoremap <A-r> :action IdeaVim.ReloadVimRc.reload<cr>
" nnoremap <Esc> <Esc>:nohl<cr>:action HideActiveWindow<cr>
nnoremap <Esc> <Esc>:nohl<cr>
nnoremap X :action ReopenClosedTab<cr>
nnoremap <A-p> :action PinActiveTabToggle<cr>
nnoremap m :action ToggleBookmark<cr>
nnoremap M :action ShowBookmarks<cr>
nnoremap <Space>pp :action CloseAllUnpinnedEditors<cr>
nnoremap <Space>jj :action Build<cr>
nnoremap <Space>jk :action Run<cr>

" set foldlevelstart=99
" set shortmess+=c
" set updatetime=100
" set termencoding=utf-8
" set fileencoding=utf-8
set timeoutlen=3000
set scrolloff=99
" set sidescrolloff=6
set number
set showcmd
set noshowmode
set hlsearch
set incsearch
set ignorecase
set smartcase
set clipboard+=unnamed,unnamedplus
set clipboard+=unnamedplus
set visualbell

if g:keyboard_layout == "colemak"
    source ~/AppData/Local/nvim/colemak.vim
elseif g:keyboard_layout == "qwer"
    source ~/AppData/Local/nvim/qwer.vim
endif


noremap  <A-u> {
noremap  <A-e> }
noremap ]p p
noremap p ]p
noremap <LEADER>ay ggyG<c-o>
noremap <LEADER>ad ggdG
noremap <LEADER>ap ggVGP
noremap <LEADER>qn @n
noremap @ @n
noremap <LEADER>e :e!<CR>
noremap <A-f> /
nnoremap tt :action GotoFile<cr>
nmap <LEADER><LEADER> <Esc>/>++><CR>:nohlsearch<CR>c4l
noremap <LEADER>ll :set cursorcolumn<CR>
" noremap   <A--> <C-o>
nnoremap - <C-o>
" noremap   <A-=> <C-i>
" nnoremap == <C-i>
nnoremap = <C-i>
inoremap <A-o> <nop>
" inoremap <A-e> <nop>
" noremap si :set splitright<CR>:vsplit<CR>
" noremap sn :set nospr<CR>:vsplit<CR>
" noremap se :set splitbelow<CR>:split<CR>
" noremap su :set nosplitbelow<CR>:split<CR>
noremap <LEADER>ta :tabe<CR>

nnoremap <A-q> :q!<CR>
nnoremap <A-w> :w<CR>
noremap ? *
noremap! <A-w> <Esc>:w<CR>
" noremap!   <Esc>
noremap <A-o> o<Esc>O
nnoremap > >>
nnoremap < <<
nnoremap <LEADER>d <C-]>
" " fold and unfold {{{
noremap <LEADER>o za

" " register yank and paste {{{
" noremap <LEADER>pn "np
" noremap <LEADER>pe "ep
" noremap <LEADER>pi "ip
" vnoremap <LEADER>yn "ny
" vnoremap <LEADER>ye "ey
" vnoremap <LEADER>yi "iy
" vnoremap  <Esc>
" " }}}

" inoremap tna 1
" inoremap tnr 2
" inoremap tns 3
" inoremap tnt 4
" inoremap tnd 5
" inoremap tnh 6
" inoremap tnn 7
" inoremap tne 8
" inoremap tni 9
" inoremap tno 0
" inoremap tnA !
" inoremap tnR @
" inoremap tnS #
" inoremap tnT $
" inoremap tnD %
" inoremap tnH ^
" inoremap tnN &
" inoremap tnE *
" inoremap tnI (
" inoremap tnO )
" inoremap tn<Enter> \n
" inoremap tnl ()<left>
" inoremap tnu []<left>
" inoremap tny <end><space>{}<left>
" inoremap tnY {}<left>
" inoremap tn<Enter> \n
" imap tn<SPACE> >++>

" " inoremap <A-l> ()<left>
" " inoremap <A-u> []<left>
" " inoremap <A-y> <end>{}<left>
" " inoremap  <Esc>
